#!C:\ruby\bin\ruby

require 'cgi'

cgi = CGI.new("html4")
@text = cgi.params['text']
if @text.empty?
	@text = "Hello world!"
end

cgi.out {
	cgi.html {
		cgi.head { 
			cgi.title { "This is a title" }
		} +

		cgi.body {
			cgi.p { @text }
		}
	}
}